package com.fw.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Order extends Model<Order>{
	private static final long serialVersionUID = 1L;
	public static Order orderDao = new Order();
	
	public Ecommerce getEcommerce(){
		String sql = "select * from e_commerce ec where ec.id = ?";
		List<Ecommerce> ecs = Ecommerce.ecommerceDao.find(sql, getInt("ec_id"));
		if(ecs.size() > 0) return ecs.get(0);
		return null;
	}
	public User getUser(){
		String sql = "select * from user u where u.u_id = ?";
		int u_id = getInt("u_id");
		List<User> us = User.userDao.find(sql, getInt("u_id"));
		if(us.size()>0) return us.get(0);
		return null;
	}
}
